package com.example.api.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.api.dao.MenuDao;
import com.example.api.model.entity.Menu;
import com.example.api.service.MenuService;
import com.example.api.utils.SecurityUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MenuServiceImpl extends ServiceImpl<MenuDao, Menu> implements MenuService {
    
    @Resource
    private MenuDao menuDao;
    
    @Override
    public List<Menu> getMenusByAdminId() {
        Integer adminId = SecurityUtil.getCurrentAdmin().getId();
        return menuDao.getMenusByAdminId(adminId);
    }

}